<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft HTML Help Workshop 4.0">
<title>To insert the JavaScript code</title>
<style>@import url(coUA.css);</style>
<link disabled rel="stylesheet" href="htmlhelp.css">
</head>

<body>

<h1>To insert the JavaScript code</h1>

<p>Insert the following JavaScript code between the <code>&lt;HEAD&gt;</code> start and end tags of an HTML file.</p>

<code>
function <i>functionOn</i>(<i>idVar</i>){<br>    
	<i>idVar</i>.style.<i>attribute="value"</i>;<br>  
}<br>
<br>
function <i>functionOff</i>(<i>idVar</i>){<br>    
	<i>idVar</i>.style.<i>attribute="value"</i>;<br>
}<br>
</code>

<p>Where <code>functionOn</code> is the name of the JavaScript function that changes the style when a user moves their cursor over the section, and <code>functionOff</code> is the script that is called when the user moves their cursor off the section. <code>attribute="value"</code> represents a style attribute that changes when the script is called. <code>idVar</code> is the ID of the element.</p>

<h3>Example</h3>

<p>The following is the JavaScript code used for the dynamic "Go" link in the HTML Help documentation:</p>

<code>
function liteGo(spNo){<br>
	spNo.style.background="#cc0033";<br>
	spNo.style.color="#FFFFFF";<br>
}<br>
<br>
function liteOff(spNo){<br>
	spNo.style.background="transparent";<br>
	spNo.style.color="#000000";<br>
}<br>
</code>

<h3>Note</h3>
<ul>
<li>You can use a <a href="ocx_scripts_globaljs.htm">global script file</a> to make it easier to maintain scripts that are used on many pages.
</li>
</ul>
<br>
<table border="0" cellpadding="0" cellspacing="4">
<tr> 
<td valign="top"><a href="ocx_dhtml_mini2c.htm"><img src="step3.gif" alt="next step" border="0"></a>
</td><td><a href="ocx_dhtml_mini2c.htm">Update your style sheet to reflect the new section</A>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>

</body>
</html>